package com.linkoog.devtools.type;

import com.intellij.openapi.extensions.ExtensionPointName;
import org.jetbrains.annotations.NotNull;

import java.util.Map;

public interface IgnoreTypeProvider {

    ExtensionPointName<IgnoreTypeProvider> EXTENSION_POINT_NAME = ExtensionPointName.create("com.github.linkoog.DevTools.ignoreTypeProvider");

    /**
     *  key：    类型全路径的名称
     *  value：  类型名称
     */
    @NotNull
    Map<String, String> getIgnoreTypes();


    class Default implements IgnoreTypeProvider{

        @Override
        public @NotNull Map<String,String> getIgnoreTypes() {
            return EXCLUDE_TYPES;
        }

        private static final Map<String,String> EXCLUDE_TYPES = Map.ofEntries(
                Map.entry( "javax.servlet.http.HttpServletRequest", "HttpServletRequest")
                ,Map.entry("javax.servlet.http.HttpServletResponse", "HttpServletResponse")
                ,Map.entry("javax.servlet.http.HttpSession", "HttpSession")
                ,Map.entry("java.io.Writer", "Writer")
                ,Map.entry("java.io.Reader", "Reader")
                ,Map.entry("java.io.OutputStream", "OutputStream")
                ,Map.entry("java.io.InputStream", "InputStream")
                ,Map.entry("java.security.Principal", "Principal")
                ,Map.entry("org.springframework.web.servlet.ModelAndView", "ModelAndView")
                ,Map.entry("org.springframework.validation.BindingResult", "BindingResult")
                ,Map.entry("org.springframework.http.RequestEntity", "RequestEntity")
                ,Map.entry("org.springframework.http.ResponseEntity", "ResponseEntity")
                ,Map.entry("org.springframework.http.HttpEntity", "HttpEntity")
                ,Map.entry("org.springframework.web.context.request.async.DeferredResult", "DeferredResult")
                ,Map.entry("org.springframework.web.context.request.async.WebAsyncTask","WebAsyncTask")
                ,Map.entry( "reactor.core.publisher.Flux","Flux")
                ,Map.entry( "reactor.core.publisher.Mono", "Mono")
                ,Map.entry( "java.util.concurrent.Callable","Callable")
                ,Map.entry( "java.util.concurrent.Future","Future")
                ,Map.entry( "java.util.concurrent.CompletableFuture","CompletableFuture")
                ,Map.entry( "java.awt.image.BufferedImage", "BufferedImage")

                // swing
                ,Map.entry( "java.awt.Component", "Component")
                ,Map.entry( "javax.swing.JComponent", "JComponent")
                ,Map.entry( "javax.swing.JLabel", "JLabel")
                ,Map.entry( "javax.swing.JButton", "JButton")
                ,Map.entry( "javax.swing.JCheckBox", "JCheckBox")
                ,Map.entry( "javax.swing.JComboBox", "JComboBox")
                ,Map.entry( "javax.swing.JEditorPane", "JEditorPane")
                ,Map.entry( "javax.swing.JFormattedTextField", "JFormattedTextField")

                // json
                ,Map.entry( "cn.hutool.json.JSONObject", "JSONObject")
                ,Map.entry( "com.alibaba.fastjson.JSONObject", "JSONObject")
                ,Map.entry( "com.alibaba.fastjson2.JSONObject", "JSONObject")

                ,Map.entry( "cn.hutool.json.JSONArray", "JSONArray")
                ,Map.entry( "com.alibaba.fastjson.JSONArray", "JSONArray")
                ,Map.entry( "com.alibaba.fastjson2.JSONArray", "JSONArray")

        );
    }




}
